import ReactDOM from 'react-dom'

// 函数组件


// 1. 定义
function Header () {
  return <header>头部组件</header>
}
const Footer = () => {
  return <footer>底部组件</footer>
}

const Loading = () => {
  const loading = true
  return loading ? <div>loading...</div> : null
}

// 2. 使用
const App = () => {
  return (
    <>
      <Header />
      <Loading />
      <Footer />
    </>
  )
}

ReactDOM.render(<App/>, document.getElementById('root'))